<template>
  <div>
    <el-table :data="tableData"  :span-method="objectSpanMethod" border style="width: 100%" :show-header="false">
      <el-table-column
        prop="category"
        label="ID"
        width="200">
      </el-table-column>
      <el-table-column
        prop="column1"
        label="姓名">
      </el-table-column>
      <el-table-column
        prop="column2"
        label="数值 1">
      </el-table-column>
      <el-table-column
        prop="column3"
        label="数值 2">
      </el-table-column>
    </el-table>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        tableData: [
          {category: 'Geodetic Satellites(6)',column1: 'EGP',column2: 'LAGEOS 1',column3: ' '},
          {category: 'Geodetic Satellites(6)',column1: 'GRACE 1',column2: 'LAGEOS 2',column3: ' '},
          {category: 'Geodetic Satellites(6)',column1: 'GRACE 2',column2: 'TOPEX',column3: ' '},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-01',column2: 'GPS BII-08',column3: 'GPS BIIA-25'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-02',column2: 'GPS BII-09',column3: 'GPS BIIA-26'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-03',column2: 'GPS BIIA-10',column3: 'GPS BIIA-27'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-04',column2: 'GPS BIIA-11',column3: 'GPS BIIA-28'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-05',column2: 'GPS BIIA-12',column3: 'GPS BIIR-02'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-06',column2: 'GPS BIIA-13',column3: 'GPS BIIR-03'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-08',column2: 'GPS BIIA-14',column3: 'GPS BIIR-04'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-09',column2: 'GPS BIIA-15',column3: 'GPS BIIR-05'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-10',column2: 'GPS BIIA-16',column3: 'GPS BIIR-06'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BI-11',column2: 'GPS BIIA-17',column3: 'GPS BIIR-07'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-01',column2: 'GPS BIIA-18',column3: 'GPS BIIR-08'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-02',column2: 'GPS BIIA-19',column3: 'GPS BIIR-09'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-03',column2: 'GPS BIIA-20',column3: 'GPS BIIR-10'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-04',column2: 'GPS BIIA-21',column3: 'GPS BIIR-11'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-05',column2: 'GPS BIIA-22',column3: 'GPS BIIR-12'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-06',column2: 'GPS BIIA-23',column3: 'GPS BIIR-13'},
          {category: 'Global Positioning System Satellites(50)',column1: 'GPS BII-07',column2: 'GPS BIIA-24',column3: ' '},
          {category: 'Space Stations(8)',column1: 'ISS (Zarya)',column2: 'Kvant-2',column3: 'Salyut 7'},
          {category: 'Space Stations(8)',column1: 'Kristall',column2: 'Mir',column3: 'Spektr'},
          {category: 'Space Stations(8)',column1: 'Kvant-1',column2: 'Priroda',column3: ' '},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-10',column2: 'KO-25',column3: 'SO-35'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-13',column2: 'LO-19',column3: 'SO-41'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-16',column2: 'MO-30',column3: 'SO-42'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-21',column2: 'MO-46',column3: 'SO-50'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-27',column2: 'NO-44',column3: 'TO-31'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-37',column2: 'NO-45',column3: 'UO-11'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-40',column2: 'OO-38',column3: 'UO-14'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-49',column2: 'PO-28',column3: 'UO-15'},
          {category: 'Amateur Radio Satellites(42)',column1: 'AO-51',column2: 'PO-34',column3: 'UO-22'},
          {category: 'Amateur Radio Satellites(42)',column1: 'DO-17',column2: 'RS-10-11',column3: 'UO-36'},
          {category: 'Amateur Radio Satellites(42)',column1: 'FO-20',column2: 'RS-12-13',column3: 'WO-18'},
          {category: 'Amateur Radio Satellites(42)',column1: 'FO-29',column2: 'RS-15',column3: 'WO-39'},
          {category: 'Amateur Radio Satellites(42)',column1: 'GO-32',column2: 'RS-16',column3: ' '},
          {category: 'Amateur Radio Satellites(42)',column1: 'IO-26',column2: 'RS-21',column3: ' '},
          {category: 'Amateur Radio Satellites(42)',column1: 'KO-23',column2: 'SO-33',column3: ' '},
          {category: 'Weather Satellites(59)',column1: 'DMSP F10',column2: 'GOES 9',column3: 'Meteor 3-04'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F11',column2: 'Meteor 2-06',column3: 'Meteor 3-05'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F12',column2: 'Meteor 2-07',column3: 'Meteor 3-06'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F13',column2: 'Meteor 2-08',column3: 'Meteor-3M'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F14',column2: 'Meteor 2-09',column3: 'NOAA 10'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F15',column2: 'Meteor 2-10',column3: 'NOAA 11'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F16',column2: 'Meteor 2-11',column3: 'NOAA 12'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F8',column2: 'Meteor 2-12',column3: 'NOAA 13'},
          {category: 'Weather Satellites(59)',column1: 'DMSP F9',column2: 'Meteor 2-13',column3: 'NOAA 14'},
          {category: 'Weather Satellites(59)',column1: 'FY 1C',column2: 'Meteor 2-14',column3: 'NOAA 15'},
          {category: 'Weather Satellites(59)',column1: 'FY 1D',column2: 'Meteor 2-15',column3: 'NOAA 16'},
          {category: 'Weather Satellites(59)',column1: 'FY 2C',column2: 'Meteor 2-16',column3: 'NOAA 17'},
          {category: 'Weather Satellites(59)',column1: 'GOES 10',column2: 'Meteor 2-17',column3: 'NOAA 6'},
          {category: 'Weather Satellites(59)',column1: 'GOES 11',column2: 'Meteor 2-18',column3: 'NOAA 7'},
          {category: 'Weather Satellites(59)',column1: 'GOES 12',column2: 'Meteor 2-19',column3: 'NOAA 8'},
          {category: 'Weather Satellites(59)',column1: 'GOES 4',column2: 'Meteor 2-20',column3: 'NOAA 9'},
          {category: 'Weather Satellites(59)',column1: 'GOES 5',column2: 'Meteor 2-21',column3: 'Nimbus 6'},
          {category: 'Weather Satellites(59)',column1: 'GOES 6',column2: 'Meteor 3-01',column3: 'Nimbus 7'},
          {category: 'Weather Satellites(59)',column1: 'GOES 7',column2: 'Meteor 3-02',column3: 'TIROS-N'},
          {category: 'Weather Satellites(59)',column1: 'GOES 8',column2: 'Meteor 3-03',column3: ' '},
          {category: 'Earth Resources Satellites(31)',column1: 'AQUA',column2: 'IRS P2',column3: 'Okean 4'},
          {category: 'Earth Resources Satellites(31)',column1: 'AURA',column2: 'IRS P3',column3: 'Okean O'},
          {category: 'Earth Resources Satellites(31)',column1: 'CBERS-1',column2: 'IRS P4',column3: 'SPOT 1'},
          {category: 'Earth Resources Satellites(31)',column1: 'ENVISAT',column2: 'IRS P6',column3: 'SPOT 2'},
          {category: 'Earth Resources Satellites(31)',column1: 'ERS-1',column2: 'JERS-1',column3: 'SPOT 3'},
          {category: 'Earth Resources Satellites(31)',column1: 'ERS-2',column2: 'Landsat 4',column3: 'SPOT 4'},
          {category: 'Earth Resources Satellites(31)',column1: 'ICESAT',column2: 'Landsat 5',column3: 'SPOT 5'},
          {category: 'Earth Resources Satellites(31)',column1: 'IRS 1A',column2: 'Landsat 7',column3: 'TERRA'},
          {category: 'Earth Resources Satellites(31)',column1: 'IRS 1B',column2: 'Okean 1',column3: 'TRMM'},
          {category: 'Earth Resources Satellites(31)',column1: 'IRS 1C',column2: 'Okean 2',column3: ' '},
          {category: 'Earth Resources Satellites(31)',column1: 'IRS 1D',column2: 'Okean 3',column3: ' '},]
      };
    },
    methods: {
      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
        if (columnIndex === 0) {
          if (rowIndex === 0) {
            return {
              rowspan: 3,
              colspan: 1
            };
          }
          else if (rowIndex === 3) {
            return {
              rowspan: 17,
              colspan: 1
            };
          }
          else if (rowIndex === 20) {
            return {
              rowspan: 3,
              colspan: 1
            };
          }
          else if (rowIndex === 23) {
            return {
              rowspan: 15,
              colspan: 1
            };
          }
          else if (rowIndex === 38) {
            return {
              rowspan: 20,
              colspan: 1
            };
          }
          else if (rowIndex === 58) {
            return {
              rowspan: 11,
              colspan: 1
            };
          }
          else {
            return [0, 0]
          }
        }
      }
    }
  };
</script>
